package com.suneast.suneaststore.bean.goodsdetail;

import android.os.Parcel;
import android.os.Parcelable;

public class ItemShopCart2UpLoading implements Parcelable {

    private int goodsId;  //产品id
    private int merchId;//店铺id
    private int optionId;    // 产品规格ID
    private String name; // 产品名称
    private String optionTitle; // 产品规格字符串
    private double width;    // 产品宽度
    private double height;    // 产品高度
    private int noLength;    // 是否有长度规格 1：有长度规格 0：无长度规格
    private int count;          // 产品数量
    private double price;        //总价
    private boolean custom;   // 是否定制
    private boolean install;  //是否上门安装
    private boolean process;  //是否加工
    private boolean suit;// 是否整卷购买 true:整卷 false :零裁
    private double installPrice; // 安装单价
    private double processPrice; // 加工单价
    private String unit; // 单位

    public ItemShopCart2UpLoading(int goodsId, int merchId, int noLength,
                                  String unit, boolean custom, int count) {
        this.goodsId = goodsId;
        this.merchId = merchId;
        this.noLength = noLength;
        this.count = count;
        this.custom = custom;
        this.unit = unit;
    }

    protected ItemShopCart2UpLoading(Parcel in) {
        goodsId = in.readInt();
        merchId = in.readInt();
        optionId = in.readInt();
        name = in.readString();
        optionTitle = in.readString();
        width = in.readDouble();
        height = in.readDouble();
        noLength = in.readInt();
        count = in.readInt();
        price = in.readDouble();
        custom = in.readByte() != 0;
        install = in.readByte() != 0;
        process = in.readByte() != 0;
        suit = in.readByte() != 0;
        installPrice = in.readDouble();
        processPrice = in.readDouble();
        unit = in.readString();
    }

    public static final Creator<ItemShopCart2UpLoading> CREATOR = new Creator<ItemShopCart2UpLoading>() {
        @Override
        public ItemShopCart2UpLoading createFromParcel(Parcel in) {
            return new ItemShopCart2UpLoading(in);
        }

        @Override
        public ItemShopCart2UpLoading[] newArray(int size) {
            return new ItemShopCart2UpLoading[size];
        }
    };

    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    public int getMerchId() {
        return merchId;
    }

    public void setMerchId(int merchId) {
        this.merchId = merchId;
    }

    public int getOptionId() {
        return optionId;
    }

    public void setOptionId(int optionId) {
        this.optionId = optionId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOptionTitle() {
        return optionTitle;
    }

    public void setOptionTitle(String specsStr) {
        this.optionTitle = specsStr;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public int getNoLength() {
        return noLength;
    }

    public void setNoLength(int noLength) {
        this.noLength = noLength;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public boolean isCustom() {
        return custom;
    }

    public void setCustom(boolean custom) {
        this.custom = custom;
    }

    public boolean isInstall() {
        return install;
    }

    public void setInstall(boolean install) {
        this.install = install;
    }

    public boolean isProcess() {
        return process;
    }

    public void setProcess(boolean process) {
        this.process = process;
    }

    public boolean isSuit() {
        return suit;
    }

    public void setSuit(boolean suit) {
        this.suit = suit;
    }

    public double getInstallPrice() {
        return installPrice;
    }

    public void setInstallPrice(double installPrice) {
        this.installPrice = installPrice;
    }

    public double getProcessPrice() {
        return processPrice;
    }

    public void setProcessPrice(double processPrice) {
        this.processPrice = processPrice;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(goodsId);
        dest.writeInt(merchId);
        dest.writeInt(optionId);
        dest.writeString(name);
        dest.writeString(optionTitle);
        dest.writeDouble(width);
        dest.writeDouble(height);
        dest.writeInt(noLength);
        dest.writeInt(count);
        dest.writeDouble(price);
        dest.writeByte((byte) (custom ? 1 : 0));
        dest.writeByte((byte) (install ? 1 : 0));
        dest.writeByte((byte) (process ? 1 : 0));
        dest.writeByte((byte) (suit ? 1 : 0));
        dest.writeDouble(installPrice);
        dest.writeDouble(processPrice);
        dest.writeString(unit);
    }
}
